<?php
include_once('class/autoload.php');
require_once('class/MyPDO.php');
require_once 'PreparationREQ.php';
$site = new page_base('inscription patient');
$site->titre = "inscription patient";
try
{
	$db= new MyPDO('mysql:host=192.168.69.26;dbname=BDD_PPE4','root','bonjour');
	$PrepREQ = new PreparationREQ($db);
	// echo $_POST['nomp'];
	
	
	$PrepREQ->insertPatient($_POST['nomp'], $_POST['prenomp'], $_POST['datenaissp'],$_POST['ruep'],$_POST['villep'], $_POST['cp'], $_POST['sexe'], $_POST['commentairep'], $_POST['medecintrait']);
}
catch (Exception $e)
{
	die('Erreur : ' . $e->getMessage());
}
$site->affiche();
?>